using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace eCloudEdit
{
    public partial class VarForm : Form
    {
        public VarForm()
        {
            InitializeComponent();
            this.comboBox1.SelectedIndex = 0;
        }

        private void label2_Click(object sender, EventArgs e)
        {

        }
        public string sVarName
        {
            get
            {
                return this.textBox1.Text;
            }
            set
            {
                this.textBox1.Text = value;
            }
        }
        public string sVarValue
        {
            get
            {
                return this.textBox2.Text;
            }
            set
            {
                this.textBox2.Text = value;
            }
        }
        public string sVarType
        {
            get
            {
               
                return this.comboBox1.GetItemText(comboBox1.SelectedItem);
            }
            set
            {

                string ss = value;
                if (ss.Equals("Bit"))
                {
                     this.comboBox1.SelectedIndex = 0;
                }
                else if (ss.Equals("Int16"))
                {
                     this.comboBox1.SelectedIndex = 1;
                }
                 else if (ss.Equals("Uint16"))
                {
                     this.comboBox1.SelectedIndex = 2;
                }
                 else if (ss.Equals("Int32"))
                {
                     this.comboBox1.SelectedIndex = 3;
                }
                 else if (ss.Equals("Uint32"))
                {
                     this.comboBox1.SelectedIndex = 4;
                }
                 else if (ss.Equals("Float"))
                {
                     this.comboBox1.SelectedIndex = 5;
                }
               
            }
        }
        public string sVarDesc
        {
            get
            {
                return this.textBox3.Text;
            }
            set
            {
                this.textBox3.Text = value;
            }
        }
        public bool bAlarmHFlag
        {
            get
            {
                return this.checkBox1.Checked;
            }
            set
            {
                this.checkBox1.Checked  = value;
            }
        }
        public string sAlarmH
        {
            get
            {
                return this.textBox4.Text;
            }
            set
            {
                this.textBox4.Text = value;
            }
        }
        public bool bAlarmLFlag
        {
            get
            {
                return this.checkBox2.Checked;
            }
            set
            {
                this.checkBox2.Checked = value;
            }
        }
        public string sAlarmL
        {
            get
            {
                return this.textBox5.Text;
            }
            set
            {
                this.textBox5.Text = value;
            }
        }
        public string sAlarmID
        {
            get
            {
                return this.textBox6.Text;
            }
            set
            {
                this.textBox6.Text = value;
            }
        }
        public string sAlarmDesc
        {
            get
            {
                return this.textBox7.Text;
            }
            set
            {
                this.textBox7.Text = value;
            }
        }
        public bool bQuickAddFlag
        {
            get
            {
                return this.checkBox3.Checked;
            }
            set
            {
                this.checkBox3.Checked = value;
            }
        }
        public string sQuickNum
        {
            get
            {
                return this.VarNumber.Text;
            }
            set
            {
                this.VarNumber.Text = value;
            }
        }
        private void button1_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.OK;
        }

        private void button2_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.Cancel;
        }
    }
}